import java.util.Arrays;
import java.util.Random;

public class Test {

    public static void testInsert(int[] array) {
        int[] tmpArray= Arrays.copyOf(array,array.length);
        long startTime=System.currentTimeMillis();
        MySort.insertSort(tmpArray);
        long endTime=System.currentTimeMillis();
        System.out.println("直接插入排序时间:"+(endTime-startTime));
    }

    public static void testShell(int[] array) {
        int[] tmpArray= Arrays.copyOf(array,array.length);
        long startTime=System.currentTimeMillis();
        MySort.shellSort(tmpArray);
        long endTime=System.currentTimeMillis();
        System.out.println("希尔排序时间:"+(endTime-startTime));
    }


    public static void initOrder(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i]=array.length-i;
        }
    }

    public static void notOrder(int[] array) {
        Random random=new Random();
        for (int i = 0; i < array.length; i++) {
            array[i]=random.nextInt(10000);
        }
    }

    public static void main(String[] args) {
       /* int[] array=new int[10_0000];
        initOrder(array);
        testInsert(array);
        testShell(array);
        int[] array2={7,5,6,8,3,1,2,4};
        MySort.bubbleSort2(array2);
        System.out.println(Arrays.toString(array2));
    */

    }

}
